﻿using System;
using DapperExtensions.Mapper;
using Newtonsoft.Json;
using ZilLion.Service.Core.Domain.EntityBase.JsonConverter;

namespace ZL.CRM.CommonEntity.Common
{
    public class AccStaInfo
    {
        /// <summary>
        /// 账户显示名称
        /// </summary>
        public string Accname { get; set; }

        /// <summary>
        /// 账户状态标识（0-正常 2-休眠）
        /// </summary>
        public short Accsta { get; set; }

        /// <summary>
        /// 状态描述
        /// </summary>
        public string Accstasm { get; set; }


        /// <summary>
        /// 折扣类别id
        /// </summary>
        public int Accdisid { get; set; }


        /// <summary>
        /// 折扣类别id
        /// </summary>
        public string Accdissm { get; set; }

        /// <summary>
        /// 手机号+|+0~8位密码
        /// </summary>
        public string Accsleeppwd { get; set; }

        /// <summary>
        /// 账户id加密值
        /// </summary>
        public string Dycardno { get; set; }


        /// <summary>
        /// 生成时间
        /// </summary>
        [JsonConverter(typeof(ChinaDateTimeConverter))]
        public DateTime Doprtime { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string Acccellno { get; set; }

        /// <summary>
        /// 卡种id
        /// </summary>
        public int Acccgsid { get; set; }

        /// <summary>
        /// 账户资料：会员性别|手机号码|农历生日|阳历生日
        /// </summary>
        public string Accinfo { get; set; }

        /// <summary>
        /// 折扣失效时间
        /// </summary>
        [JsonConverter(typeof(ChinaDateTimeConverter))]
        public DateTime? Accdissxsj { get; set; }

    }
    public class AccStaInfoMapper : ClassMapper<AccStaInfo>
    {
        public AccStaInfoMapper()
        {
            Table("#AccInfo");
            Map(f => f.Accname).Column("accname");
            Map(f => f.Accsta).Column("accsta");
            Map(f => f.Acccellno).Column("acccellno");
            Map(f => f.Accsleeppwd).Column("Accsleeppwd");
            Map(f => f.Accstasm).Column("accstasm");
            Map(f => f.Accdisid).Column("accdisid");
            Map(f => f.Accdissm).Column("accdissm");
            Map(f => f.Acccgsid).Column("acccgsid");
            Map(f => f.Accinfo).Column("accinfo");
            Map(f => f.Dycardno).Column("dycardno");
            Map(f => f.Doprtime).Column("doprtime");
            Map(f => f.Accdissxsj).Column("accdissxsj");
        }
    }
}
